#ifndef CAPTURE_H
#define CAPTURE_H
#include <string>
#include <QTimer>
#include <QCoreApplication>
#include <opencv2/opencv.hpp>
#include <opencv2/dnn.hpp>
//using namespace cv::dnn;
//using namespace cv;
using namespace std;

#include <QWidget>

class capture : public QWidget
{
    Q_OBJECT
private: QString videoaddress;
         cv::VideoCapture *cap;
         cv::Mat *frame;
public:
    explicit capture(QWidget *parent = nullptr);
         ~capture();
    QTimer *timer;
    void openVideo();
    void openCamera();
    cv::Mat* readFrame();
    void setVideoAddress(QString);

signals:
    void start();
    void stop();
    void switchSource();
public slots:
    void startTimer();
    void stopTimer();
};

#endif // CAPTURE_H
